package com.lcj.demo.repository;

import com.lcj.demo.domain.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface EmployeeRepository extends JpaRepository<Employee,Long> {
    @Query(value = "select e from Employee as e where e.id like '%'||?1||'%'  or" +
            " e.department like '%'||?1||'%'  or e.phone like '%'||?1||'%'  or e.sex like '%'||?1||'%'  or e.username like '%'||?1||'%' ")
    List<Employee> findAllBySearchKey(String searchKey);

}
